Attribute VB_Name = "fmod_errors"
' =============================================================================================== '
' FMOD Ex - Error Visual Basic Module. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2008. '
'                                                                                                 '
' Use this module if you want to store or display a string version / english explanation of       '
' the FMOD error codes.                                                                           '
'                                                                                                 '
' =============================================================================================== '

Public Function FMOD_ErrorString(errcode As FMOD_RESULT) As String
    Select Case errcode
        Case Is = FMOD_OK:                         FMOD_ErrorString = "No errors."
        Case Is = FMOD_ERR_ALREADYLOCKED:          FMOD_ErrorString = "Tried to call lock a second time before unlock was called. "
        Case Is = FMOD_ERR_BADCOMMAND:             FMOD_ErrorString = "Tried to call a function on a data type that does not allow this type of functionality (ie calling Sound::lock on a streaming sound). "
        Case Is = FMOD_ERR_CDDA_DRIVERS:           FMOD_ErrorString = "Neither NTSCSI nor ASPI could be initialised. "
        Case Is = FMOD_ERR_CDDA_INIT:              FMOD_ErrorString = "An error occurred while initialising the CDDA subsystem. "
        Case Is = FMOD_ERR_CDDA_INVALID_DEVICE:    FMOD_ErrorString = "Couldn't find the specified device. "
        Case Is = FMOD_ERR_CDDA_NOAUDIO:           FMOD_ErrorString = "No audio tracks on the specified disc. "
        Case Is = FMOD_ERR_CDDA_NODEVICES:         FMOD_ErrorString = "No CD/DVD devices were found. "
        Case Is = FMOD_ERR_CDDA_NODISC:            FMOD_ErrorString = "No disc present in the specified drive. "
        Case Is = FMOD_ERR_CDDA_READ:              FMOD_ErrorString = "A CDDA read error occurred. "
        Case Is = FMOD_ERR_CHANNEL_ALLOC:          FMOD_ErrorString = "Error trying to allocate a channel. "
        Case Is = FMOD_ERR_CHANNEL_STOLEN:         FMOD_ErrorString = "The specified channel has been reused to play another sound. "
        Case Is = FMOD_ERR_COM:                    FMOD_ErrorString = "A Win32 COM related error occured. COM failed to initialize or a QueryInterface failed meaning a Windows codec or driver was not installed properly. "
        Case Is = FMOD_ERR_DMA:                    FMOD_ErrorString = "DMA Failure.  See debug output for more information. "
        Case Is = FMOD_ERR_DSP_CONNECTION:         FMOD_ErrorString = "DSP connection error.  Connection possibly caused a cyclic dependancy. "
        Case Is = FMOD_ERR_DSP_FORMAT:             FMOD_ErrorString = "DSP Format error.  A DSP unit may have attempted to connect to this network with the wrong format. "
        Case Is = FMOD_ERR_DSP_NOTFOUND:           FMOD_ErrorString = "DSP connection error.  Couldn't find the DSP unit specified. "
        Case Is = FMOD_ERR_DSP_RUNNING:            FMOD_ErrorString = "DSP error.  Cannot perform this operation while the network is in the middle of running.  This will most likely happen if a connection or disconnection is attempted in a DSP callback. "
        Case Is = FMOD_ERR_DSP_TOOMANYCONNECTIONS: FMOD_ErrorString = "DSP connection error.  The unit being connected to or disconnected should only have 1 input or output. "
        Case Is = FMOD_ERR_FILE_BAD:               FMOD_ErrorString = "Error loading file. "
        Case Is = FMOD_ERR_FILE_COULDNOTSEEK:      FMOD_ErrorString = "Couldn't perform seek operation.  This is a limitation of the medium (ie netstreams) or the file format. "
        Case Is = FMOD_ERR_FILE_DISKEJECTED:       FMOD_ErrorString = "Media was ejected while reading. "
        Case Is = FMOD_ERR_FILE_EOF:               FMOD_ErrorString = "End of file unexpectedly reached while trying to read essential data (truncated data?). "
        Case Is = FMOD_ERR_FILE_NOTFOUND:          FMOD_ErrorString = "File not found. "
        Case Is = FMOD_ERR_FILE_UNWANTED:          FMOD_ErrorString = "Unwanted file access occured. "
        Case Is = FMOD_ERR_FORMAT:                 FMOD_ErrorString = "Unsupported file or audio format. "
        Case Is = FMOD_ERR_HTTP:                   FMOD_ErrorString = "A HTTP error occurred. This is a catch-all for HTTP errors not listed elsewhere. "
        Case Is = FMOD_ERR_HTTP_ACCESS:            FMOD_ErrorString = "The specified resource requires authentication or is forbidden. "
        Case Is = FMOD_ERR_HTTP_PROXY_AUTH:        FMOD_ErrorString = "Proxy authentication is required to access the specified resource. "
        Case Is = FMOD_ERR_HTTP_SERVER_ERROR:      FMOD_ErrorString = "A HTTP server error occurred. "
        Case Is = FMOD_ERR_HTTP_TIMEOUT:           FMOD_ErrorString = "The HTTP request timed out. "
        Case Is = FMOD_ERR_INITIALIZATION:         FMOD_ErrorString = "FMOD was not initialized correctly to support this function. "
        Case Is = FMOD_ERR_INITIALIZED:            FMOD_ErrorString = "Cannot call this command after System::init. "
        Case Is = FMOD_ERR_INTERNAL:               FMOD_ErrorString = "An error occured that wasn't supposed to.  Contact support. "
        Case Is = FMOD_ERR_INVALID_ADDRESS:        FMOD_ErrorString = "On Xbox 360, this memory address passed to FMOD must be physical, (ie allocated with XPhysicalAlloc.) "
        Case Is = FMOD_ERR_INVALID_FLOAT:          FMOD_ErrorString = "Value passed in was a NaN, Inf or denormalized float. "
        Case Is = FMOD_ERR_INVALID_HANDLE:         FMOD_ErrorString = "An invalid object handle was used. "
        Case Is = FMOD_ERR_INVALID_PARAM:          FMOD_ErrorString = "An invalid parameter was passed to this function. "
        Case Is = FMOD_ERR_INVALID_SPEAKER:        FMOD_ErrorString = "An invalid speaker was passed to this function based on the current speaker mode. "
        Case Is = FMOD_ERR_INVALID_SYNCPOINT : FMOD_ErrorString = "The syncpoint did not come from this sound handle."
        Case Is = FMOD_ERR_INVALID_VECTOR : FMOD_ErrorString = "The vectors passed in are not unit length, or perpendicular. "
        Case Is = FMOD_ERR_IRX:                    FMOD_ErrorString = "PS2 only.  fmodex.irx failed to initialize.  This is most likely because you forgot to load it. "
        Case Is = FMOD_ERR_MAXAUDIBLE:             FMOD_ErrorString = "Reached maximum audible playback count for this sound's soundgroup. "
        Case Is = FMOD_ERR_MEMORY:                 FMOD_ErrorString = "Not enough memory or resources. "
        Case Is = FMOD_ERR_MEMORY_CANTPOINT:       FMOD_ErrorString = "Can't use FMOD_OPENMEMORY_POINT on non PCM source data, or non mp3/xma/adpcm data if FMOD_CREATECOMPRESSEDSAMPLE was used. "
        Case Is = FMOD_ERR_MEMORY_IOP:             FMOD_ErrorString = "PS2 only.  Not enough memory or resources on PlayStation 2 IOP ram. "
        Case Is = FMOD_ERR_MEMORY_SRAM:            FMOD_ErrorString = "Not enough memory or resources on console sound ram. "
        Case Is = FMOD_ERR_NEEDS2D:                FMOD_ErrorString = "Tried to call a command on a 3d sound when the command was meant for 2d sound. "
        Case Is = FMOD_ERR_NEEDS3D:                FMOD_ErrorString = "Tried to call a command on a 2d sound when the command was meant for 3d sound. "
        Case Is = FMOD_ERR_NEEDSHARDWARE:          FMOD_ErrorString = "Tried to use a feature that requires hardware support.  (ie trying to play a VAG compressed sound in software on PS2). "
        Case Is = FMOD_ERR_NEEDSSOFTWARE:          FMOD_ErrorString = "Tried to use a feature that requires the software engine.  Software engine has either been turned off, or command was executed on a hardware channel which does not support this feature. "
        Case Is = FMOD_ERR_NET_CONNECT:            FMOD_ErrorString = "Couldn't connect to the specified host. "
        Case Is = FMOD_ERR_NET_SOCKET_ERROR:       FMOD_ErrorString = "A socket error occurred.  This is a catch-all for socket-related errors not listed elsewhere. "
        Case Is = FMOD_ERR_NET_URL:                FMOD_ErrorString = "The specified URL couldn't be resolved. "
        Case Is = FMOD_ERR_NET_WOULD_BLOCK:        FMOD_ErrorString = "Operation on a non-blocking socket could not complete immediately. "
        Case Is = FMOD_ERR_NOTREADY:               FMOD_ErrorString = "Operation could not be performed because specified sound is not ready. "
        Case Is = FMOD_ERR_OUTPUT_ALLOCATED:       FMOD_ErrorString = "Error initializing output device, but more specifically, the output device is already in use and cannot be reused. "
        Case Is = FMOD_ERR_OUTPUT_CREATEBUFFER:    FMOD_ErrorString = "Error creating hardware sound buffer. "
        Case Is = FMOD_ERR_OUTPUT_DRIVERCALL:      FMOD_ErrorString = "A call to a standard soundcard driver failed, which could possibly mean a bug in the driver or resources were missing or exhausted. "
        Case Is = FMOD_ERR_OUTPUT_ENUMERATION:     FMOD_ErrorString = "Error enumerating the available driver list. List may be inconsistent due to a recent device addition or removal."
        Case Is = FMOD_ERR_OUTPUT_FORMAT:          FMOD_ErrorString = "Soundcard does not support the minimum features needed for this soundsystem (16bit stereo output). "
        Case Is = FMOD_ERR_OUTPUT_INIT:            FMOD_ErrorString = "Error initializing output device. "
        Case Is = FMOD_ERR_OUTPUT_NOHARDWARE:      FMOD_ErrorString = "FMOD_HARDWARE was specified but the sound card does not have the resources nescessary to play it. "
        Case Is = FMOD_ERR_OUTPUT_NOSOFTWARE:      FMOD_ErrorString = "Attempted to create a software sound but no software channels were specified in System::init. "
        Case Is = FMOD_ERR_PAN:                    FMOD_ErrorString = "Panning only works with mono or stereo sound sources. "
        Case Is = FMOD_ERR_PLUGIN:                 FMOD_ErrorString = "An unspecified error has been returned from a 3rd party plugin. "
        Case Is = FMOD_ERR_PLUGIN_INSTANCES:       FMOD_ErrorString = "The number of allowed instances of a plugin has been exceeded "
        Case Is = FMOD_ERR_PLUGIN_MISSING:         FMOD_ErrorString = "A requested output, dsp unit type or codec was not available. "
        Case Is = FMOD_ERR_PLUGIN_RESOURCE:        FMOD_ErrorString = "A resource that the plugin requires cannot be found. (ie the DLS file for MIDI playback) "
        Case Is = FMOD_ERR_RECORD:                 FMOD_ErrorString = "An error occured trying to initialize the recording device. "
        Case Is = FMOD_ERR_REVERB_INSTANCE:        FMOD_ErrorString = "Specified Instance in FMOD_REVERB_PROPERTIES couldn't be set. Most likely because another application has locked the EAX4 FX slot. "
        Case Is = FMOD_ERR_SUBSOUND_ALLOCATED:     FMOD_ErrorString = "This subsound is already being used by another sound, you cannot have more than one parent to a sound.  Null out the other parent's entry first. "
        Case Is = FMOD_ERR_SUBSOUND_CANTMOVE:      FMOD_ErrorString = "Shared subsounds cannot be replaced or moved from their parent stream, such as when the parent stream is an FSB file."
        Case Is = FMOD_ERR_SUBSOUND_MODE:          FMOD_ErrorString = "The subsound's mode bits do not match with the parent sound's mode bits.  See documentation for function that it was called with."
        Case Is = FMOD_ERR_SUBSOUNDS:              FMOD_ErrorString = "The error occured because the sound referenced contains subsounds.  (ie you cannot play the parent sound as a static sample, only its subsounds.) "
        Case Is = FMOD_ERR_TAGNOTFOUND:            FMOD_ErrorString = "The specified tag could not be found or there are no tags. "
        Case Is = FMOD_ERR_TOOMANYCHANNELS:        FMOD_ErrorString = "The sound created exceeds the allowable input channel count.  This can be increased using the maxinputchannels parameter in System::setSoftwareFormat. "
        Case Is = FMOD_ERR_UNIMPLEMENTED:          FMOD_ErrorString = "Something in FMOD hasn't been implemented when it should be! contact support! "
        Case Is = FMOD_ERR_UNINITIALIZED:          FMOD_ErrorString = "This command failed because System::init or System::setDriver was not called. "
        Case Is = FMOD_ERR_UNSUPPORTED:            FMOD_ErrorString = "A command issued was not supported by this object.  Possibly a plugin without certain callbacks specified. "
        Case Is = FMOD_ERR_UPDATE:                 FMOD_ErrorString = "An error caused by System::update occured. "
        Case Is = FMOD_ERR_VERSION:                FMOD_ErrorString = "The version number of this file format is not supported. "

        Case Is = FMOD_ERR_EVENT_FAILED:           FMOD_ErrorString = "An Event failed to be retrieved, most likely due to 'just fail' being specified as the max playbacks behavior. "
        Case Is = FMOD_ERR_EVENT_INFOONLY:         FMOD_ErrorString = "Can't execute this command on an EVENT_INFOONLY event. "
        Case Is = FMOD_ERR_EVENT_INTERNAL:         FMOD_ErrorString = "An error occured that wasn't supposed to.  See debug log for reason. "
        Case Is = FMOD_ERR_EVENT_MAXSTREAMS:       FMOD_ErrorString = "Event failed because 'Max streams' was hit when FMOD_INIT_FAIL_ON_MAXSTREAMS was specified. "
        Case Is = FMOD_ERR_EVENT_MISMATCH:         FMOD_ErrorString = "FSB mis-matches the FEV it was compiled with. "
        Case Is = FMOD_ERR_EVENT_NAMECONFLICT:     FMOD_ErrorString = "A category with the same name already exists. "
        Case Is = FMOD_ERR_EVENT_NOTFOUND:         FMOD_ErrorString = "The requested event, event group, event category or event property could not be found. "
        Case Else:                                 FMOD_ErrorString = "Unknown error."
    End Select
End Function
